import request from '@/utils/request'

export default {
// 分页查询设备管理
  queryList(data) {
    return request({
      url: '/energy-carbon/ecp-admin/dataFilling/queryPage',
      method: 'post',
      data
    })
  },
  queryEnergyConsumptionType(activityType) {
    return request({
      url: '/energy-carbon/ecp-admin/dataFilling/energyConsumptionType',
      method: 'GET',
      params: { activityType }
    })
  },
  calculateCarbonEmission(energyConsumptionTypeId, usage, startTime, endTime) {
    return request({
      url: '/energy-carbon/ecp-admin/dataFilling/calculateCarbonEmission',
      method: 'GET',
      params: { energyConsumptionTypeId, usage, startTime, endTime }
    })
  },
  detail(id) {
    return request({
      url: '/energy-carbon/ecp-admin/dataFilling/detail',
      method: 'GET',
      params:{id}
    })
  },
  add(data) {
    return request({
      url: '/energy-carbon/ecp-admin/dataFilling/add',
      method: 'POST',
      data
    })
  },
  update(data) {
    return request({
      url: '/energy-carbon/ecp-admin/dataFilling/update',
      method: 'POST',
      data
    })
  },
  deleteById(data) {
    return request({
      url: '/energy-carbon/ecp-admin/dataFilling/deleteById',
      method: 'POST',
      data
    })
  }
}
